#include "jFileIO.h"

jFileIO::jFileIO()
{

}
jFileIO::~jFileIO()
{
}

void jFileIO::recieveData(string Date, string LevelName, string Algorithm, string ticksElapsed, string NoAgents, string reCalcuations, string collisions)
{
	//int CharSize;
	//CharSize += Date.size();
	//
	//char DataStreamChar[CharSize];

	//DataStream.push_back(
	//DataStream = "Date:- " + Date + "/n";
	DataStream = "Date:- ";
	DataStream += Date;
	DataStream += "\n";

	DataStream += "Level Name:- ";
	DataStream += LevelName;
	DataStream += "\n";

	DataStream += "Algorithm:- ";
	DataStream += Algorithm;
	DataStream += "\n";

	DataStream += "ticksElapsed:- ";
	DataStream += ticksElapsed;
	DataStream += "\n";

	DataStream += "No of Agents:- ";
	DataStream += NoAgents;
	DataStream += "\n";

	DataStream += "ReCalculations :- ";
	DataStream += reCalcuations;
	DataStream += "\n";

	DataStream += "Collisions :- ";
	DataStream += collisions;
	DataStream += "\n";



}

bool jFileIO::writeToFile(string name)
{
  string fileName;
  fileName = name;
  fileName += ".txt";


  ofstream myfile;
  myfile.open(fileName.c_str());
  myfile << DataStream.c_str();
  myfile.close();
  return true;

}